// Copyright (C) 2009 by NHN Corporation. All rights reserved.
// Released under the terms of the GNU General Public License version 2 or later.
package fitnesse.responders.chart;

import junit.framework.Assert;
import junit.framework.TestCase;
import fitnesse.FitNesseContext;
import fitnesse.http.MockRequest;
import fitnesse.http.Response;

public class ChartResponderTest extends TestCase {
	public void testMakePng() throws Exception {
		FitNesseContext context = new FitNesseContext();
		ChartResponder responder = new ChartResponder();
		MockRequest request = new MockRequest();
		request.addInput("data", "1,2,3");

		Response response = responder.makeResponse(context, request);
		Assert.assertEquals("image/png", response.getContentType());
	}

	public void testError() throws Exception {
		FitNesseContext context = new FitNesseContext();
		ChartResponder responder = new ChartResponder();
		MockRequest request = new MockRequest();
		request.addInput("aa", "1,2,3");

		Response response = responder.makeResponse(context, request);
		Assert.assertEquals("text/plain", response.getContentType());
	}
}
